<?php
session_start();
require_once("dbconnect.php");
ob_start();
$exeName=$_SESSION['user'];
$sql="select * from executives where exe_name='$exeName';";
//echo $sql;
$result=mysql_query($sql) or die(mysql_error());
while($r=mysql_fetch_assoc($result))
	{
	$id=$r['id'];
	
	}
$frmDate=dateconvert($_GET['frmDate'],1);
//echo $frmDate;
$toDate=dateconvert($_GET['toDate'],1);
$qry="select * from enquiry where exe_id='$id' and curr_date between '$frmDate' and '$toDate';";
//echo $qry;
$res=mysql_query($qry) or die(mysql_error());

function dateconvert($date,$func) 
{	
if ($func == 1)
{ //insert conversion
list($day, $month, $year) = split('[/.-]', $date);
$date = "$year-$month-$day";
return $date;
}
}
function dateconvrt($date,$func) 
{	
if ($func == 1)
{ //insert conversion
list($year, $month, $day) = split('[/.-]', $date);
$date = "$day-$month-$year";
return $date;
}
}
 ?>
 
 <script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		$('#infoTable').dataTable();
	} );
</script>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>


<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><div id="demo">
      <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#F7A886" class="tablebox" id="infoTable">
        <thead>
          <tr background="images/hed-bg.jpg" style="background-repeat:repeat-x; background-position:left top">
            <th width="56" height="40" align="center" valign="middle" class="hed"><strong>Sr. No </strong></th>
            <th width="156" align="center" valign="middle" class="hed"><strong>Enquiry Number</strong></th>
            <th width="156" align="center" valign="middle" class="hed"><strong>Date</strong></th>
            <th width="199" align="center" valign="middle" class="hed"><strong>Organisation </strong></th>
            <th width="125" align="center" valign="middle" class="hed"><strong>Enquiry Type</strong></th>
            <th width="191" align="center" valign="middle" class="hed"><strong>Bid Type</strong></th>
            <th width="189" align="center" valign="middle" class="hed"><strong>Duedate</strong></th>
          </tr>
        </thead>
        <tbody>
          <?php 
				 $i=1;
				while($row=mysql_fetch_assoc($res))
					{
						$edate=$row['curr_date'];
						$org=$row['org_name'];
						$enqtype=$row['enqiry_type'];
						$techbid=$row['technical_bid'];
						$pricebid=$row['price_bid'];
						$duedate=dateconvrt($row['due_date'],1);
						$enqnum=$row['enq_num'];	
					
				?>
          <tr>
            <td bgcolor="#FEF5E7"><?php echo $i;?></td>
            <td bgcolor="#FEF5E7"><div class="popup" id="pop<?php echo $i;?>" ><?php echo $enqnum;?></div> <div id="bulletinDialogpop<?php echo $i;?>" style="display: none;" ></div></td>
            <td bgcolor="#FEF5E7"><?php echo $edate;?></td>
            <td bgcolor="#FEF5E7"><?php echo $org;?></td>
            <td bgcolor="#FEF5E7"><?php echo $enqtype;?></td>
            <td bgcolor="#FEF5E7"><?php 
					if($techbid==1){echo " Technical Bid ";}
					if(($techbid==1) && ($pricebid==1)) {echo "And";}
					if($pricebid==1){echo " Price Bid ";}
					?></td>
            <td bgcolor="#FEF5E7"><?php echo $duedate;?></td>
          </tr>
          <?php 
				  $i++;
				}
				?>
        </tbody>
      </table>
    </div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
